/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.audit.service.api;


import com.koron.audit.domain.Audit;
import com.koron.common.domain.DataBean;
import org.swan.bean.MessageBean;

import java.util.Date;
import java.util.List;

public interface AuditService {
    /**
     * 新增审批记录
     * @param audit
     * @return
     */
    Integer insert(Audit audit);

    /**
     * 批量新增审批记录
     * @param auditList
     * @return
     */
    Integer batchInsert(List<Audit> auditList);

    /**
     * 修改审批记录
     * @param audit
     * @return
     */
    Integer update(Audit audit);

    /**
     * 批量修改审批记录
     * @param auditList
     * @return
     */
    Integer batchUpdate(List<Audit> auditList);

    /**
     * 根据主键删除审批记录
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 根据主键获取审批记录详情
     * @param id
     * @return
     */
    Audit queryOne(String id);

    /**
     * 根据指定条件查询审批记录列表
     * @param title 标题
     * @param time 时间
     * @param state 审批状态
     * @param start 起始位置
     * @param rows 数据条数
     * @return
     */
    List<Audit> queryByCondition( String code,String title,String flowName, Date time,
                                 Integer state,Integer start,Integer rows);

    /**
     * 根据指定条件统计审批记录数量
     * @param title
     * @param time
     * @param state
     * @return
     */
    Integer countByCondition( String code,String title,String flowName,Date time, Integer state);

    MessageBean<DataBean<Audit>> queryByIdList(List<String> idList, String code,String title,String flowName,Integer state, Date time, Integer start, Integer rows,String keyword);

    MessageBean<DataBean<Audit>> queryByInitiator(String initiatorCode, String code,String title,String flowName, Date time,
                                                  Integer state,Integer start,Integer rows, String keyword);

    Audit queryByProcessId(String processInstId);

    Audit queryByBusinessIds(String id,Date updateTime);

    Audit getAuditByBusinessId(String businessId);
}
